home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 4976 < prev    next >
Encoding:
Text File  |  1996-08-06  |  834 b   |  29 lines

  1. Path: news.compuserve.com!newsmaster
  2. From: <73067.3334@compuserve.com>
  3. Newsgroups: comp.lang.c++
  4. Subject: "new" creams data structure -- why?
  5. Date: 1 Feb 1996 23:08:16 GMT
  6. Organization: CompuServe Incorporated
  7. Message-ID: <4erh50$4hp@dub-news-svc-3.compuserve.com>
  8. NNTP-Posting-Host: dd40-180.compuserve.com
  9. Content-Type: text/plain
  10. Keywords: new memory
  11. Content-length: 417
  12. X-Newsreader: AIR Mosaic (16-bit) version 4.00.08.32
  13.  
  14.  
  15. dear experts:  why would the following line alloc memory where there is
  16. insufficient space for it?  when i memcpy to clear the string, it wipes out
  17. a data structure i needed.  the line is
  18.  
  19.   char* somestring = new char [300];
  20.  
  21. when it's my fault i can deal with it, but how do i prevent this?  or is it
  22. a scoping problem or something?
  23.  
  24. many thanks for any ideas.
  25.  
  26. stephen toney
  27. 73067.3334@compuserve.com
  28.  
  29.